Skip to content

feat: Add UserPublicController and unit tests#11

Merged
lukaDjordjevic01 merged 1 commit intodevelopfrom
feature/user-public
Feb 19, 2026
Merged

feat: Add UserPublicController and unit tests#11
lukaDjordjevic01 merged 1 commit intodevelopfrom
feature/user-public

Conversation

@janosevicsm
Copy link
Contributor

Introduce UserPublicController with GET /api/user/{id} endpoint that returns a UserResponse via UserService.getProfile(UUID) and is protected by @RequireRole({"HOST","GUEST"}). Add comprehensive unit tests (UserPublicControllerTest) using MockMvc to cover successful access for HOST and GUEST, missing auth headers (401), forbidden role (403), and user-not-found mapping to 404 via GlobalExceptionHandler. Tests configure UserContextResolver and RoleAuthorizationInterceptor to simulate request context and authorization.

Introduce UserPublicController with GET /api/user/{id} endpoint that returns a UserResponse via UserService.getProfile(UUID) and is protected by @RequireRole({"HOST","GUEST"}). Add comprehensive unit tests (UserPublicControllerTest) using MockMvc to cover successful access for HOST and GUEST, missing auth headers (401), forbidden role (403), and user-not-found mapping to 404 via GlobalExceptionHandler. Tests configure UserContextResolver and RoleAuthorizationInterceptor to simulate request context and authorization.
@janosevicsm janosevicsm self-assigned this Feb 18, 2026
@sonarqubecloud
Copy link

@lukaDjordjevic01 lukaDjordjevic01 merged commit 7e72c2c into develop Feb 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments